import React, {Component} from 'react';

class TopicDetail extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        console.log(this.props);
        const state = this.props.location.state;
        return (<div>
            <h3 className="detail_title">{state.topic.title}</h3>
            <div className="topicInfo">
                <img className="avatar" src={state.topic.author.avatar_url}/>
                <div className="left">
                    <span>{state.topic.author.loginname}</span>
                    <span>hah</span>
                </div>
                <div className="right">
                    <span className={"type " + (state.topic.top? "top":"share")}>置顶</span>
                    <span className="visit">{state.topic.visit_count}次浏览</span>
                </div>
            </div>
            <section
                className="markdown-body topic-content"
                dangerouslySetInnerHTML={{ __html: state.topic.content}}
            />
        </div>);
    }
}

export default TopicDetail;